
// jsx 中表达式
function App() {
  const name = "Jack";
  const sayHi = ()=>{
    return "😀"
  }
  let obj = {
    name:"Thomas"
  }
  let arr = ["1",1,<h1 key="1">123</h1>,"🍎","🍌"];
  return (
    <div>
      你好，我叫：{name}
      {/*数字*/}
      <h1>{1}</h1>
      {/*算术表达式*/}
      <h1>{1+1}</h1>
      {/*字符*/}
      <h1>{"(*^_^*)"}</h1>
      {/*调用函数*/}
      <h1>{sayHi()}</h1>
      {/*另外一个jsx*/}
      <h1>{<p>另外一个jsx</p>}</h1>
      {/*三目运算符*/}
      { 1>0?"真":"假"}
      {/*语句 是不允许的*/}
      {/* <h1>{ if(1>0)}</h1> */}
      {/* <h1>{for(let i=0;i<0;i++){}}</h1> */}
      {/*对象 是不允许的 界面报错
      Error: Objects are not valid as a React child (found: object with keys {name}). 
      If you meant to render a collection of children, use an array instead.
      */}
      {/* {obj} */}
      {/* 数组 */}
      {arr}

    </div>
  );
}

export default App;
